home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Precision Software Appli…tions Silver Collection 1
/
Precision Software Applications Silver Collection Volume One (PSM) (1993).iso
/
tutor
/
modula12.exe
/
ARRAYS.MOD
< prev
next >
Wrap
Text File
|
1988-10-26
|
792b
|
26 lines
(* Chapter 6 - Program 1 *)
MODULE Arrays;
FROM InOut IMPORT WriteString, WriteCard, WriteLn;
VAR Index : CARDINAL;
Automobiles : ARRAY [1..12] OF CARDINAL;
BEGIN (* main program *)
FOR Index := 1 TO 12 DO
Automobiles[Index] := Index + 10;
END;
Automobiles[7] := 54; (* example, change one value of array *)
WriteString("This is the first program with an array.");
WriteLn;
WriteLn; (* end of data initialization *)
FOR Index := 1 TO 12 DO (* display the data now *)
WriteString("Automobile number");
WriteCard(Index,3);
WriteString(" has the value of");
WriteCard(Automobiles[Index],3);
WriteLn;
END;
END Arrays.